home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / tango2.lha / PLAY.S < prev    next >
Encoding:
Text File  |  1988-07-19  |  7.1 KB  |  394 lines

  1. ;                **********************************************
  2. ;                ** THE MUZAX PLAY ROUTINE FOR NOISE TRACKER ** 
  3. ;                  ******************************************
  4.  
  5.  
  6. MUZAX:
  7.  
  8.     jsr    Cryptic_init
  9.  
  10. end:    rts
  11. Cryptic_init:
  12.     lea    Cryptic_data,a0
  13.     add.l    #$03b8,a0
  14.     moveq    #$7f,d0
  15.     moveq    #0,d1
  16. Cryptic_init1:
  17.     move.l    d1,d2
  18.     subq.w    #1,d0
  19. Cryptic_init2:
  20.     move.b    (a0)+,d1
  21.     cmp.b    d2,d1
  22.     bgt.s    Cryptic_init1
  23.     dbf        d0,Cryptic_init2
  24.     addq.b    #1,d2
  25. Cryptic_init3:
  26.     lea        Cryptic_data,a0
  27.     lea        Cryptic_sample1(pc),a1
  28.     asl.l    #8,d2
  29.     asl.l    #2,d2
  30.     add.l    #$438,d2
  31.     add.l    a0,d2
  32.     moveq    #$1e,d0
  33. Cryptic_init4:
  34.     move.l    d2,(a1)+
  35.     moveq    #0,d1
  36.     move.w    42(a0),d1
  37.     asl.l    #1,d1
  38.     add.l    d1,d2
  39.     add.l    #$1e,a0
  40.     dbf        d0,Cryptic_init4
  41.     lea        Cryptic_sample1(PC),a0
  42.     moveq    #0,d0
  43. Cryptic_clear:
  44.     move.l    (a0,d0.w),a1
  45.     clr.l    (a1)
  46.     addq.w    #4,d0
  47.     cmp.w    #$7c,d0
  48.     bne.s    Cryptic_clear
  49.     clr.w    $dff0a8
  50.     clr.w    $dff0b8
  51.     clr.w    $dff0c8
  52.     clr.w    $dff0d8
  53.     clr.l    Cryptic_partnrplay
  54.     clr.l    Cryptic_partnote
  55.     clr.l    Cryptic_partpoint
  56.     move.b    Cryptic_data+$3b6,Cryptic_maxpart+1
  57.     rts
  58.     rts
  59. Cryptic_music:
  60.     addq.w    #1,Cryptic_counter
  61. Cryptic_cool:
  62.     cmp.w    #6,Cryptic_counter
  63.     bne.s    Cryptic_notsix
  64.     clr.w    Cryptic_counter
  65.     bra        Cryptic_rout2
  66. Cryptic_notsix:
  67.     lea        Cryptic_aud1temp(PC),a6
  68.     tst.b    3(a6)
  69.     beq.s    Cryptic_arp1
  70.     lea        $dff0a0,a5        
  71.     bsr.s    Cryptic_arprout
  72. Cryptic_arp1:
  73.     lea    Cryptic_aud2temp(PC),a6
  74.     tst.b    3(a6)
  75.     beq.s    Cryptic_arp2
  76.     lea        $dff0b0,a5
  77.     bsr.s    Cryptic_arprout
  78. Cryptic_arp2:
  79.     lea        Cryptic_aud3temp(PC),a6
  80.     tst.b    3(a6)
  81.     beq.s    Cryptic_arp3
  82.     lea        $dff0c0,a5
  83.     bsr.s    Cryptic_arprout
  84. Cryptic_arp3:
  85.     lea        Cryptic_aud4temp(PC),a6
  86.     tst.b    3(a6)
  87.     beq.s    Cryptic_arp4
  88.     lea        $dff0d0,a5
  89.     bra.s    Cryptic_arprout
  90. Cryptic_arp4:
  91.     rts
  92. Cryptic_arprout:
  93.     move.b    2(a6),d0
  94.     and.b    #$0f,d0
  95.     tst.b    d0
  96.     beq        Cryptic_arpegrt
  97.     cmp.b    #$01,d0
  98.     beq.s    Cryptic_portup
  99.     cmp.b    #$02,d0
  100.     beq.s    Cryptic_portdwn
  101.     cmp.b    #$0a,d0
  102.     beq.s    Cryptic_volslide
  103.     rts
  104. Cryptic_portup:
  105.     moveq    #0,d0
  106.     move.b    3(a6),d0
  107.     sub.w    d0,22(a6)
  108.     cmp.w    #$71,22(a6)
  109.     bpl.s    Cryptic_ok1
  110.     move.w    #$71,22(a6)
  111. Cryptic_ok1:    
  112.     move.w    22(a6),6(a5)
  113.     rts
  114. Cryptic_portdwn:
  115.     moveq    #0,d0
  116.     move.b    3(a6),d0
  117.     add.w    d0,22(a6)
  118.     cmp.w    #$538,22(a6)
  119.     bmi.s    Cryptic_ok2
  120.     move.w    #$538,22(a6)
  121. Cryptic_ok2:    
  122.     move.w    22(a6),6(a5)
  123.     rts
  124. Cryptic_volslide:
  125.     moveq    #0,d0
  126.     move.b    3(a6),d0
  127.     lsr.b    #4,d0
  128.     tst.b    d0
  129.     beq.s    Cryptic_voldwn
  130.     add.w    d0,18(a6)
  131.     cmp.w    #64,18(a6)
  132.     bmi.s    Cryptic_ok3
  133.     move.w    #64,18(a6)
  134. Cryptic_ok3:    
  135.     move.w    18(a6),8(a5)
  136.     rts
  137. Cryptic_voldwn:
  138.     moveq    #0,d0
  139.     move.b    3(a6),d0
  140.     and.b    #$0f,d0
  141.     sub.w    d0,18(a6)
  142.     bpl.s    Cryptic_ok4
  143.     clr.w    18(a6)
  144. Cryptic_ok4:    
  145.     move.w    18(a6),8(a5)
  146.     rts
  147. Cryptic_arpegrt:
  148.     move.w    Cryptic_counter(PC),d0
  149.     cmp.w    #1,d0
  150.     beq.s    Cryptic_loop2
  151.     cmp.w    #2,d0
  152.     beq.s    Cryptic_loop3
  153.     cmp.w    #3,d0
  154.     beq.s    Cryptic_loop4
  155.     cmp.w    #4,d0
  156.     beq.s    Cryptic_loop2
  157.     cmp.w    #5,d0
  158.     beq.s    Cryptic_loop3
  159.     rts
  160. Cryptic_loop2:
  161.     moveq    #0,d0
  162.     move.b    3(a6),d0
  163.     lsr.b    #4,d0
  164.     bra.s    Cryptic_cont
  165. Cryptic_loop3:
  166.     moveq    #$00,d0
  167.     move.b    3(a6),d0
  168.     and.b    #$0f,d0
  169.     bra.s    Cryptic_cont
  170. Cryptic_loop4:
  171.     move.w    16(a6),d2
  172.     bra.s    Cryptic_endpart
  173. Cryptic_cont:
  174.     add.w    d0,d0
  175.     moveq    #0,d1
  176.     move.w    16(a6),d1
  177.     and.w    #$fff,d1
  178.     lea        Cryptic_arpeggio(PC),a0
  179. Cryptic_loop5:
  180.     move.w    (a0,d0),d2
  181.     cmp.w    (a0),d1
  182.     beq.s    Cryptic_endpart
  183.     addq.l    #2,a0
  184.     bra.s    Cryptic_loop5
  185. Cryptic_endpart:
  186.     move.w    d2,6(a5)
  187.     rts
  188. Cryptic_rout2:
  189.     lea        Cryptic_data,a0
  190.     move.l    a0,a3
  191.     add.l    #$0c,a3
  192.     move.l    a0,a2
  193.     add.l    #$3b8,a2
  194.     add.l    #$43c,a0
  195.     move.l    Cryptic_partnrplay(PC),d0
  196.     moveq    #0,d1
  197.     move.b    (a2,d0),d1
  198.     asl.l    #8,d1
  199.     asl.l    #2,d1
  200.     add.l    Cryptic_partnote(PC),d1
  201.     move.l    d1,Cryptic_partpoint
  202.     clr.w    Cryptic_dmacon
  203.     lea        $dff0a0,a5
  204.     lea        Cryptic_aud1temp(PC),a6
  205.     bsr        Cryptic_playit
  206.     lea        $dff0b0,a5
  207.     lea        Cryptic_aud2temp(PC),a6
  208.     bsr        Cryptic_playit
  209.     lea        $dff0c0,a5
  210.     lea        Cryptic_aud3temp(PC),a6
  211.     bsr        Cryptic_playit
  212.     lea        $dff0d0,a5
  213.     lea        Cryptic_aud4temp(PC),a6
  214.     bsr        Cryptic_playit
  215.     move.w    #$01f4,d0
  216. Cryptic_rls:    
  217.     dbf        d0,Cryptic_rls
  218.     move.w    #$8000,d0
  219.     or.w    Cryptic_dmacon,d0
  220.     move.w    d0,$dff096
  221.     lea        Cryptic_aud4temp(PC),a6
  222.     cmp.w    #1,14(a6)
  223.     bne.s    Cryptic_voice3
  224.     move.l    10(a6),$dff0d0
  225.     move.w    #1,$dff0d4
  226. Cryptic_voice3:
  227.     lea        Cryptic_aud3temp(PC),a6
  228.     cmp.w    #1,14(a6)
  229.     bne.s    Cryptic_voice2
  230.     move.w    #1,$dff0c4
  231. Cryptic_voice2:
  232.     lea        Cryptic_aud2temp(PC),a6
  233.     cmp.w    #1,14(a6)
  234.     bne.s    Cryptic_voice1
  235.     move.l    10(a6),$dff0b0
  236.     move.w    #1,$dff0b4
  237. Cryptic_voice1:
  238.     lea        Cryptic_aud1temp(PC),a6
  239.     cmp.w    #1,14(a6)
  240.     bne.s    Cryptic_voice0
  241.     move.l    10(a6),$dff0a0
  242.     move.w    #1,$dff0a4
  243. Cryptic_voice0:
  244.     move.l    Cryptic_partnote(PC),d0
  245.     add.l    #$10,d0
  246.     move.l    d0,Cryptic_partnote
  247.     cmp.l    #$400,d0
  248.     bne.s    Cryptic_stop
  249. Cryptic_higher:
  250.     clr.l    Cryptic_partnote
  251.     addq.l    #1,Cryptic_partnrplay
  252.     moveq    #0,d0
  253.     move.w    Cryptic_maxpart(PC),d0
  254.     move.l    Cryptic_partnrplay(PC),d1
  255.     cmp.l    d0,d1
  256.     bne.s    Cryptic_stop
  257.     clr.l    Cryptic_partnrplay
  258.     ;st    Pflag
  259. Cryptic_stop:
  260.     tst.w    Cryptic_status
  261.     beq.s    Cryptic_stop2
  262.     clr.w    Cryptic_status
  263.     bra.s    Cryptic_higher
  264. Cryptic_stop2:
  265.     rts
  266. Cryptic_playit:
  267.     move.l    (a0,d1.l),(a6)
  268.     addq.l    #4,d1
  269.     moveq    #0,d2
  270.     move.b    2(a6),d2
  271.     and.b    #$f0,d2
  272.     lsr.b    #4,d2
  273.     move.b    (a6),d0
  274.     and.b    #$f0,d0
  275.     or.b    d0,d2
  276.     tst.b    d2
  277.     beq.s    Cryptic_nosamplechange
  278.     moveq    #0,d3
  279.     lea    Cryptic_samples(PC),a1
  280.     move.l    d2,d4
  281.     asl.l    #2,d2
  282.     mulu    #$1e,d4
  283.     move.l    (a1,d2),4(a6)
  284.     move.w    (a3,d4.l),8(a6)
  285.     move.w    2(a3,d4.l),18(a6)
  286.     move.w    4(a3,d4.l),d3
  287.     tst.w    d3
  288.     beq.s    Cryptic_displace
  289.     move.l    4(a6),d2
  290.     add.l    d3,d2
  291.     move.l    d2,4(a6)
  292.     move.l    d2,10(a6)
  293.     move.w    6(a3,d4.l),8(a6)
  294.     move.w    6(a3,d4.l),14(a6)
  295.     move.w    18(a6),8(a5)
  296.     bra.s    Cryptic_nosamplechange
  297. Cryptic_displace:
  298.     move.l    4(a6),d2
  299.     add.l    d3,d2
  300.     move.l    d2,10(a6)
  301.     move.w    6(a3,d4.l),14(a6)
  302.     move.w    18(a6),8(a5)
  303. Cryptic_nosamplechange:
  304.     move.w    (a6),d0
  305.     and.w    #$fff,d0
  306.     tst.w    d0
  307.     beq.s    Cryptic_retrout
  308.     move.w    (a6),16(a6)
  309.     move.w    20(a6),$dff096
  310.     move.l    4(a6),(a5)
  311.     move.w    8(a6),4(a5)
  312.     move.w    (a6),d0
  313.     and.w    #$fff,d0
  314.     move.w    d0,6(a5)
  315.     move.w    20(a6),d0
  316.     or.w    d0,Cryptic_dmacon
  317. Cryptic_retrout:
  318.     tst.w    (a6)
  319.     beq.s    Cryptic_nonewper
  320.     move.w    (a6),22(a6)
  321. Cryptic_nonewper:
  322.     move.b    2(a6),d0
  323.     and.b    #$0f,d0
  324.     cmp.b    #$0b,d0
  325.     beq.s    Cryptic_posjmp
  326.     cmp.b    #$0c,d0
  327.     beq.s    Cryptic_setvol
  328.     cmp.b    #$0d,d0
  329.     beq.s    Cryptic_break
  330.     cmp.b    #$0e,d0
  331.     beq.s    Cryptic_setfil
  332.     cmp.b    #$0f,d0
  333.     beq.s    Cryptic_setspeed
  334.     rts
  335. Cryptic_posjmp:
  336.     not.w    Cryptic_status
  337.     moveq    #0,d0
  338.     move.b    3(a6),d0
  339.     subq.b    #1,d0
  340.     move.l    d0,Cryptic_partnrplay
  341.     rts
  342. Cryptic_setvol:
  343.     move.b    3(a6),8(a5)
  344.     rts
  345. Cryptic_break:
  346.     not.w    Cryptic_status
  347.     rts
  348. Cryptic_setfil:
  349.     moveq    #0,d0
  350.     move.b    3(a6),d0
  351.     and.b    #1,d0
  352.     rol.b    #1,d0
  353.     and.b    #$fd,$bfe001
  354.     or.b    d0,$bfe001
  355.     rts
  356. Cryptic_setspeed:
  357.     move.b    3(a6),d0
  358.     and.b    #$0f,d0
  359.     beq.s    Cryptic_back
  360.     clr.w    Cryptic_counter
  361.     move.b    d0,Cryptic_cool+3
  362. Cryptic_back:    rts
  363. Cryptic_aud1temp:
  364.     dcb.w    10,0
  365.     dc.w    1
  366.     dcb.w    2,0
  367. Cryptic_aud2temp:
  368.     dcb.w    10,0
  369.     dc.w    2
  370.     dcb.w    2,0
  371. Cryptic_aud3temp:
  372.     dcb.w    10,0
  373.     dc.w    4
  374.     dcb.w    2,0
  375. Cryptic_aud4temp:
  376.     dcb.w    10,0
  377.     dc.w    8
  378.     dcb.w    2,0
  379. Cryptic_partnote:    dc.l    0
  380. Cryptic_partnrplay:    dc.l    0
  381. Cryptic_counter:    dc.w    0
  382. Cryptic_partpoint:    dc.l    0
  383. Cryptic_samples:    dc.l    0
  384. Cryptic_sample1:    dcb.l    31,0
  385. Cryptic_maxpart:    dc.w    0
  386. Cryptic_dmacon:    dc.w    0
  387. Cryptic_status:    dc.w    0
  388. Cryptic_arpeggio:
  389.     dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  390.     dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  391.     dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  392.     dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  393.     dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  394.